Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test GenAI Courses #287

Closed
wants to merge 1 commit into from
Closed

Test GenAI Courses #287

wants to merge 1 commit into from

Conversation

adam-cowley
Copy link
Contributor

@adam-cowley adam-cowley commented Dec 12, 2024

Adds a requirements.txt file to the course directory with dependencies (currently tied to version),and pytest integration tests to test the code works.

Ideally, requirements.txt will be versionless to test for breaking changes or deprecation notices on current versions and notify of any changes.

For the remote repos (llm-chatbot-python, etc), these can be run via a scheduled github action to regularly test on the current version.

Additional Updates

  • Update langchain-community imports to langchain-neo4j in contained code
  • Added example tests for any python code used in the course
  • Added standard naming convention for the OPENAI_API_KEY, loaded from .env file

Updates to imports:

Old Import New Import
from langchain_community.graphs import Neo4jGraph from langchain_neo4j import Neo4jGraph
from langchain_community.vectorstores import Neo4jVector from langchain_neo4j import Neo4jVector
from langchain_community.chat_message_histories import Neo4jChatMessageHistory from langchain_neo4j.chat_message_histories.neo4j import Neo4jChatMessageHistory

OPENAI_API_KEY variable

This will establish a convention across all courses that is in line with other platforms (deeplearning, DataCamp)

Replace:

llm = OpenAI(openai_api_key="sk-...")

With:

import os 

OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
llm = OpenAI(openai_api_key=OPENAI_API_KEY)

TODO:

  • All python scripts should have a test or be removed from the repo
  • Add pytest integration tests to course repos:
    • llm-chatbot-python
    • llm-knowledge-graph-construction
    • llm-vectors-unstructured
    • genai-workshop
    • genai-workshop-graphrag
  • Prefer langchain-neo4j changes from Updates courses to use the LangChain Neo4j package #284

@adam-cowley adam-cowley added enhancement New feature or request update labels Dec 12, 2024
@adam-cowley adam-cowley changed the title Update langchain-community to langchain-neo4j Test GenAI Courses Dec 12, 2024
@martinohanlon
Copy link
Contributor

Closed in favour of #293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants